import request from '@/utils/request'

// 查询雇主资料列表
export function listUser(query) {
  return request({
    url: '/business/employer/list',
    method: 'get',
    params: query
  })
}

// 查询雇主资料详细
export function getUser(id) {
  return request({
    url: '/business/employer/' + id,
    method: 'get'
  })
}

// 新增雇主资料
export function addUser(data) {
  return request({
    url: '/business/employer',
    method: 'post',
    data: data
  })
}

// 修改雇主资料
export function updateUser(data) {
  return request({
    url: '/business/employer',
    method: 'put',
    data: data
  })
}

// 删除雇主资料
export function delUser(id) {
  return request({
    url: '/business/employer/' + id,
    method: 'delete'
  })
}

// 雇主-查看-树状结构
export function menuTree(query) {
  return request({
    url: '/personnel/user/menuTree',
    method: 'get',
    params: query
  })
}
// 雇主权限
export function permissionSettings(data) {
  return request({
    url: '/personnel/user/permissionSettings',
    method: 'post',
    data
  })
}

// 雇主停用启用
export function userAble(id) {
  return request({
    url: '/business/employer/able/' + id,
    method: 'get',
  })
}
// 客户停用启用
export function userClientAble(id) {
  return request({
    url: '/business/client/able/' + id,
    method: 'get',
  })
}

// 雇主-职位信息
export function positionList(data) {
  return request({
    url: '/business/position/list',
    method: 'get',
    params: data
  })
}

// 雇主-职位信息新增
export function systemPositionAdd(data) {
  return request({
    url: '/business/position',
    method: 'post',
    data
  })
}

// 雇主-职位信息编辑
export function systemPositionUpdata(data) {
  return request({
    url: '/business/position',
    method: 'PUT',
    data
  })
}
// 雇主-职位信息-删除
export function delPosition(id) {
  return request({
    url: '/business/position/' + id,
    method: 'delete'
  })
}

// 绩效列表
export function jixiaoList(query) {
  return request({
    url: '/business/jxPerformance/list',
    method: 'get',
    params: query
  })
}
// 绩效组列表
export function jixiaogroupList(query) {
  return request({
    url: '/business/jxPerformanceGroup/list',
    method: 'get',
    params: query
  })
}

// 查询绩效组绩效表
export function getGroup(id) {
  return request({
    url: '/system/group/' + id,
    method: 'get'
  })
}
// 查询绩效题目
export function getTable(id) {
  return request({
    url: '/business/jxPerformance/' + id,
    method: 'get'
  })
}
// 修改审核人详情
export function performance(data) {
  return request({
    url: '/business/jxPerformanceEmployerConfig/modifyReviewer',
    method: 'post',
    data
  })
}
// 绩效列表--用到的
export function pageList(query) {
  return request({
    url: '/business/jxPerformanceEmployerConfig/list',
    method: 'get',
    params: query
  })
}
// 审批
export function processList(query) {
  return request({
    url: '/business/approval/process/list',
    method: 'get',
    params: query
  })
}
// 审批流程-新增
export function approvalProcess(data) {
  return request({
    url: '/business/approval/process',
    method: 'post',
    data
  })
}
// 审批流程-编辑
export function approvalProcessUp(data) {
  return request({
    url: '/business/approval/process',
    method: 'put',
    data
  })
}


// 雇主-审批流程-删除
export function approvalprocessdel(id) {
  return request({
    url: '/business/approval/process/' + id,
    method: 'delete'
  })
}
// 绩效组-分发绩效
export function distribution(id) {
  return request({
    url: '/business/jxPerformanceEmployerConfig/createPerformanceEmployee/' + id,
    method: 'post',
  })
}
// 雇员字段设定
export function employeefieldconfig(data) {
  return request({
    url: '/business/employee/file/config',
    method: 'post',
    data
  })
}
export function employeefieldconfigInfo(id) {
  return request({
    url: '/business/employee/file/config',
    method: 'get',
  })
}
// 查询审核人
export function performanceInfo(id) {
  return request({
    url: '/business/jxPerformanceEmployerConfig/' + id,
    method: 'get',
  })
}

export function deptTree(employerId) {
  return request({
    url: '/business/employer/dept/deptTree/' + employerId,
    method: 'get',
  })
}
export function getAllEmployer() {
  return request({
    url: '/business/employer/getAllEmployer',
    method: 'get',
  })
}

export function addDept(data) {
  return request({
    url: '/business/employer/dept',
    method: 'post',
    data
  })
}

export function updateDept(data) {
  return request({
    url: '/business/employer/dept',
    method: 'put',
    data
  })
}
export function deleteDept(id) {
  return request({
    url: `/business/employer/dept/${id}`,
    method: 'delete',
  })
}

// 设置负责人
export function setResponsiblePerson(params) {
  return request({
    url: '/business/employer/setResponsiblePerson',
    method: 'get',
    params
  })
}
